package org.example.hw;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author: lynn
 * @Descript:
 * @date: 2021/2/27 18:48
 * @version: 1.0
 */
public class test100 {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String a,b,c;
        while (true){
            a = scanner.nextLine();
            b = scanner.nextLine();
            c = scanner.nextLine();
            if("-1".equals(scanner.nextLine())){
                break;
            }
        }
        int totalLength = Integer.parseInt(a);
        int smallStep = Integer.parseInt(b.split(" ")[0]);
        int bigStep = Integer.parseInt(b.split(" ")[1]);
        int stoneNum = Integer.parseInt(b.split(" ")[2]);
        int minToneCount = calculateCountOnStone(totalLength, smallStep, bigStep, stoneNum, c, 0, 0);
        System.out.println(minToneCount);
    }

    public static int calculateCountOnStone(int totalLength,int smallStep,int bigStep,int stoneNum, String toneLocations, int passToneNum, int startLocation){
        if (passToneNum == stoneNum || startLocation == totalLength){
            return 0;
        }

        int[] arr = new int[bigStep-smallStep+1];
        for (int i=0;i<arr.length;i++){
            int step = startLocation+smallStep+i;
            arr[i] = 0;
            int tmpPassToneNum=passToneNum;
            if (step < totalLength) {
                boolean isTone = isTone(step, toneLocations);
                if (isTone) {
                    arr[i] += 1;
                    tmpPassToneNum++;
                }
                arr[i] += calculateCountOnStone(totalLength, smallStep, bigStep, stoneNum, toneLocations, tmpPassToneNum, step);
            }
        }

        Arrays.sort(arr);
        return arr[0];
    }

    public static boolean isTone(int location, String toneLocations){
        String[] baseLocations = toneLocations.split(" ");
        for (String item: baseLocations) {
            if (item.equals(String.valueOf(location))){
                return true;
            }
        }
        return false;
    }


}
